﻿@{
    ViewBag.Title = "菜肴列表";
    Layout = "~/Views/Shared/_LayoutList.cshtml"; 
}
@(       
 Html.nbGridFor<Dish>(s =>
 {
     s.Action("List");
     s.Columns(c =>
     {
         c.Bind(m => m.Id).IsKey();
         c.BindEnum(m => m.MainMaterialType, "MaterialCategory").AsSearch();
         c.BindEnum(m => m.Category, "DishType").AsSearch();
         c.Bind(m => m.Name).Width(100).AsQuery().AsSearch().Align(GridAlign.Left);
         c.Bind(m => m.Cost).Width(50).Align(GridAlign.Right);
         c.Bind(m => m.ItemDesc).Width("auto").Align(GridAlign.Left).AsQuery().AsSearch();
         c.Bind(m => m.UpdateUser).Width(60);
         c.BindDateTime(m => m.UpdateDate);
         c.BindTemplate()
            .Template(Url.GridRowEditLink("编辑菜肴"))
            .Template(Url.GridRowDeleteLink("Name"));
     });
     s.Buttons(b =>
     {
         b.BindAddButton("新建菜肴");
         b.BindDeleteButton();
         b.Bind(GridButtonType.Import, "导入菜肴").Action(Url.Action("Import", new { excelKey = "Dish" }));
     });
 }))